<!DOCTYPE html>
<html lang="zh">

<head>
<meta charset="UTF-8">
<title>个人中心</title>
<script src="../ele/vue.js"></script>
<link rel="stylesheet" href="../ele/index.css" />
<link rel="stylesheet" href="../css/info.css" />
<script src="../ele/index.js"></script>
<script src="../js/axios.js"></script>
</head>

<body>
<div id="app">
    <el-container>
        <el-header height="180px">
            <el-row type="flex" justify="center" align="middle" class="top">
                <el-col :offset="2" :span="5" class="t-left">
                    <el-image style="height: 40px" src="../image/logo.png"></el-image>
                </el-col>
                <el-col :span="8" class="t-center">
                    <span class="t-wb t-12">大学实训项目</span>
                </el-col>
                <el-col :span="5" class="t-right">
                    <el-dropdown @command="handleCommand">
                        <span class="t-wb">欢迎 , 张无忌 </span>
                        <el-dropdown-menu slot="dropdown" >
                            <el-dropdown-item>个人中心</el-dropdown-item>
                            <el-dropdown-item>用户设置</el-dropdown-item>
                            <el-dropdown-item command="logout" divided>退出登录</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </el-col>
                <el-col :span="3" class="t-left pd-l15">
                    <el-avatar :size="25" src="../image/cc.jpg">
                    </el-avatar>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center" align="middle" class="search">
                <el-col :span="16" class="t-center">
                    <el-input placeholder="请输入搜索内容" v-model="key" class="input-with-select search-inp">
                        <el-button slot="append" type="warning" plain @click="search()">搜索</el-button>
                    </el-input>
                </el-col>
                <el-col :span="8" class="t-center">
                    <el-avatar shape="square" :size="100" src="../image/"></el-avatar>
                </el-col>
            </el-row>
        </el-header>
        <el-container>
            <el-aside width="65%">
                <template v-for="item in cvList">
                    <el-card shadow="hover" class="cv-card">
                        <div>
                            <el-row type="flex" justify="start" align="middle">
                                <el-col :span="20" class="card-one">
                                    <el-link :href="'../page/info.html?id='+item.id">
                                    <span class="t-bb t-18">求职：
                                        {{item.desiredDirection}}
                                        【<span>{{item.desiredPlace}}</span>】
                                        <span class="card-sal">￥{{item.desiredSalary/100}}</span>
                                    </span></el-link><br><br>
                                
                                    <el-tag type="info">{{item.degree}}</el-tag>
                                    <el-tag type="success">
                                        <span v-if="item.desiredStatus=='0'">全职</span>
                                        <span v-if="item.desiredStatus=='1'">兼职</span>
                                        <span v-if="item.desiredStatus=='2'">全职/兼职</span>
                                    </el-tag>
                                    <el-tag type="danger">3年经验</el-tag>
                                </el-col>
                                <el-col :span="2" class="t-center">
                                    <el-avatar :size="50" src="../image/cc.jpg">
                                    </el-avatar><br>
                                    <span>{{item.name}}</span>
                                </el-col>
                            </el-row>
                        </div>
                    </el-card>
                </template>
            </el-aside>
            <el-main>
                <template>
                    <el-row type="flex" justify="start" align="middle" class="t-wb pd-15">
                        <el-col :span="7" class="t-center">
                            <el-avatar :size="100" :src="member.avatarUrl">
                            </el-avatar>
                        </el-col>
                        <el-col :span="9" class="t-center">
                            <span class="t-bb t-24 pd-l15">{{member.petName}}</span><span class="t-14">
                                <el-divider direction="vertical"></el-divider>
                            </span><br>
                            <span class="t-12">简历完成度65%</span>
                        </el-col>
                        <el-col :span="8" class="t-right">
                            <el-button type="info" round @click="toCV()">
                                <b>编辑简历</b><br>
                            </el-button>
                        </el-col>
                    </el-row>
                    <el-row type="flex" justify="center" align="middle" class="row-top">
                        <el-col :span="8" class="t-center">
                            <span>0</span>
                        </el-col>
                        <el-col :span="8" class="t-center">
                            <span>0</span>
                        </el-col>
                        <el-col :span="8" class="t-center">
                            <span>0</span>
                        </el-col>
                    </el-row>
                    <el-row type="flex" justify="center" align="middle" class="row-inf">
                        <el-col :span="8" class="t-center">
                            <span>谁看过我</span>
                        </el-col>
                        <el-col :span="8" class="t-center">
                            <span>我的投递</span>
                        </el-col>
                        <el-col :span="8" class="t-center">
                            <span>我的收藏</span>
                        </el-col>
                    </el-row>
                </template>
                <template>
                    <el-row type="flex" justify="center" align="middle" class="row-top"
                        style="margin-top: 15px;padding: 15px;">
                        <el-col :span="24" class="t-left">
                            <span class="t-18 t-bb">我的自荐信</span>
                        </el-col>
                        <el-col :span="4" class="t-right">
                            <el-button type="info" plain size="mini">编辑</el-button>
                        </el-col>
                    </el-row>
                </template>
                <template>
                    <el-row type="flex" justify="center" align="middle" class="ys-top">
                        <el-col :span="24" class="t-left">
                            <span class="t-18 t-bb">隐私设置</span>
                        </el-col>
                        <el-col :span="4" class="t-right">
                            <el-button type="info" plain size="mini">编辑</el-button>
                        </el-col>
                    </el-row>
                    <el-row type="flex" justify="center" align="middle" class="ys-inf">
                        <el-col :span="20" class="t-left">
                            <span>谁能查看我的简历</span>
                        </el-col>
                        <el-col :span="4" class="t-right">
                            <span>所有人</span>
                        </el-col>
                    </el-row>
                    <el-row type="flex" justify="center" align="middle" class="ys-inf">
                        <el-col :span="20" class="t-left">
                            <span>手机号码保护</span>
                        </el-col>
                        <el-col :span="4" class="t-right">
                            <span>已开启</span>
                        </el-col>
                    </el-row>
                    <el-row type="flex" justify="center" align="middle" class="ys-inf">
                        <el-col :span="20" class="t-left">
                            <span>公开自荐信</span>
                        </el-col>
                        <el-col :span="4" class="t-right">
                            <span>未公开</span>
                        </el-col>
                    </el-row>
                </template>
            </el-main>
        </el-container>
    </el-container>
    <div style="height:300px;"></div>
</div>
</body>
<script type="text/javascript">
var test = new Vue({
    el: '#app',
    data: {
        key: "",
        member:{},
        cvList:[]
    },
    created(){
        let member = localStorage.getItem("MEMBER");
        if(!member){
            window.location.href="/";
        }
        this.member = JSON.parse(member);
        this.getData();
    },
    methods: {
        search(){
            let t = this;
            //搜索
            axios.get("/cv/likeQuery/"+t.key).then(res=>{
                console.log(res.data.data)
                t.cvList=res.data.data;
            })

        },
        getData(){
            let t = this;
            axios.get("/cv/selectAll").then(res=>{
                t.cvList=res.data.data
            })
        },
        toCV(){
            //编辑简历页面
            window.location.href="cv.html";
        },
        handleCommand(command){
            if("logout"===command){
                this.logout();
            }
        },
        logout(){
            let t = this;
            this.$confirm('确认退出系统?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'danger'
            }).then(() => {
                t.$message.success("退出成功");
                window.location.href="/";
                
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });
            });
        }
    }
})

</script>

</html>